package com.freewater.cargotracker.domain.model.paint;

import org.apache.commons.lang3.Validate;

public class StockPaint implements Paint {

    private double volume;

    private PigmentColor color;

    public StockPaint(double volume, PigmentColor color) {
        Validate.isTrue(volume > 0, "Volume must be positive number");
        Validate.notNull(color, "Color is required");

        this.volume = volume;
        this.color = color;
    }

    @Override
    public double getVolume() {
        return volume;
    }

    @Override
    public PigmentColor getColor() {
        return color;
    }

    @Override
    public String toString() {
        final StringBuffer sb = new StringBuffer("StockPaint{");
        sb.append("volume=").append(volume);
        sb.append(", color=").append(color);
        sb.append('}');
        return sb.toString();
    }
}
